<meta charset="utf-8">
(#) Other typographical problems

!!! WARNING: Other typographical problems
   This is a warning.

Id
:   `TypographyOther`
Summary
:   Other typographical problems
Severity
:   Warning
Category
:   Usability: Typography
Platform
:   Android
Vendor
:   Android Open Source Project
Feedback
:   https://issuetracker.google.com/issues/new?component=192708
Since
:   Initial
Affects
:   Resource files
Editing
:   This check runs on the fly in the IDE editor
Implementation
:   [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/TypographyDetector.kt)
Tests
:   [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/TypographyDetectorTest.kt)
Copyright Year
:   2011

This check looks for miscellaneous typographical problems and offers
replacement                     sequences that will make the text easier
to read and your application more                     polished.

!!! Tip
   This lint check has an associated quickfix available in the IDE.

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
res/values/typography.xml:8:Warning: Replace (c) with copyright symbol ©
(&#169;) ? [TypographyOther]
    &lt;string name="copyright"&gt;(c) 2011&lt;/string&gt;
                             --------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is the source file referenced above:

`res/values/typography.xml`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers

&lt;resources&gt;
    &lt;string name="home_title"&gt;Home 'Sample'&lt;/string&gt;
    &lt;string name="show_all_apps"&gt;"All"&lt;/string&gt;
    &lt;string name="show_all_apps2"&gt;Show "All"&lt;/string&gt;
    &lt;string name="escaped"&gt;Skip \"All\"&lt;/string&gt;
    &lt;string name="single"&gt;Android's&lt;/string&gt;
    &lt;string name="copyright"&gt;(c) 2011&lt;/string&gt;
    &lt;string name="badquotes1"&gt;`First'&lt;/string&gt;
    &lt;string name="badquotes2"&gt;``second''&lt;/string&gt;
    &lt;string name="notbadquotes"&gt;Type Option-` then 'Escape'&lt;/string&gt;
    &lt;string name="fraction1"&gt;5 1/2 times&lt;/string&gt;
    &lt;string name="fraction4"&gt;1/4 times&lt;/string&gt;
    &lt;string name="notfraction"&gt;51/2 times, 1/20&lt;/string&gt;
    &lt;string name="ellipsis"&gt;40 times...&lt;/string&gt;
    &lt;string name="notellipsis"&gt;40 times.......&lt;/string&gt;
    &lt;string name="ndash"&gt;For ages 3-5&lt;/string&gt;
    &lt;string name="ndash2"&gt;Copyright 2007 - 2011&lt;/string&gt;
    &lt;string name="nontndash"&gt;x-y&lt;/string&gt;
    &lt;string name="mdash"&gt;Not found -- please try again&lt;/string&gt;
    &lt;string name="nontndash"&gt;----&lt;/string&gt;
    &lt;string name="notdirectional"&gt;A's and B's&lt;/string&gt;
    &lt;string-array name="typography"&gt;
        &lt;item&gt;Ages 3-5&lt;/item&gt;
        &lt;item&gt;Age 5 1/2&lt;/item&gt;
    &lt;/string-array&gt;
    &lt;string name="ndash"&gt;X Y Z: 10 10 -1&lt;/string&gt;
    &lt;string name="ga_trackingId"&gt;UA-0000-0&lt;/string&gt;
    &lt;string&gt;something somthing d\'avoir something something l\'écran.&lt;/string&gt;
&lt;/resources&gt;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also visit the
[source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/TypographyDetectorTest.kt)
for the unit tests for this check to see additional scenarios.

(##) Suppressing

You can suppress false positives using one of the following mechanisms:

* Adding the suppression attribute `tools:ignore="TypographyOther"` on
  the problematic XML element (or one of its enclosing elements). You
  may also need to add the following namespace declaration on the root
  element in the XML file if it's not already there:
  `xmlns:tools="http://schemas.android.com/tools"`.

  ```xml
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;resources xmlns:tools="http://schemas.android.com/tools"&gt;
      ...
      &lt;string tools:ignore="TypographyOther" .../&gt;
    ...
  &lt;/resources&gt;
  ```

* Using a special `lint.xml` file in the source tree which turns off
  the check in that folder and any sub folder. A simple file might look
  like this:
  ```xml
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;lint&gt;
      &lt;issue id="TypographyOther" severity="ignore" /&gt;
  &lt;/lint&gt;
  ```
  Instead of `ignore` you can also change the severity here, for
  example from `error` to `warning`. You can find additional
  documentation on how to filter issues by path, regular expression and
  so on
  [here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html).

* In Gradle projects, using the DSL syntax to configure lint. For
  example, you can use something like
  ```gradle
  lintOptions {
      disable 'TypographyOther'
  }
  ```
  In Android projects this should be nested inside an `android { }`
  block.

* For manual invocations of `lint`, using the `--ignore` flag:
  ```
  $ lint --ignore TypographyOther ...`
  ```

* Last, but not least, using baselines, as discussed
  [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).

<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://morgan3d.github.io/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>